package com.nimitz.event.service.impl;

import com.nimitz.event.domain.Event;
import com.nimitz.event.domain.EventResult;
import com.nimitz.event.mapper.EventMapper;
import com.nimitz.event.service.EventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

@Service
public class EventServiceImpl implements EventService {
    @Autowired
    private EventMapper eventMapper;

    @Override
    public void addEvent(Event event) {
        eventMapper.addEvent(event);
    }

    @Override
    public List<EventResult> selectAll(LocalDate createTime, String state) {

        List<EventResult> list = eventMapper.selectAll(createTime,state);
        return list;
    }

    @Override
    public void updateEvent(Event event) {
        eventMapper.updateEvent(event);
    }

    @Override
    public Event selectById(Long id) {
        Event event = eventMapper.selectById(id);
        return event;
    }

    @Override
    public void deleteById(Long id) {
        eventMapper.deleteById(id);
    }

}
